<template>
  <div>
    <el-button @click="label='zh'">中文</el-button>
    <el-button @click="label='en'">English</el-button>
    <div>{{ t('sayhi') }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      label: 'zh',
      zidian: {
        zh: {
          sayhi: '你好'
        },
        en: {
          sayhi: 'hello'
        }
      }
    }
  },
  created() {
    console.log(25, this.$t)
  },
  methods: {
    t(str) {
      return this.zidian[this.label][str]
    }
  }
}
</script>

<style>

</style>
